package com.dgut.hisystem.controller;

import com.dgut.hisystem.entity.Prescription;
import com.dgut.hisystem.service.PrescriptionService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/prescription")
@RestController
public class PrescriptionController {
    @Resource
    private PrescriptionService prescriptionService;

    @RequestMapping("/get")
    Prescription getPrescriptionById(long id) {
        return prescriptionService.getPrescriptionById(id);
    }

    @RequestMapping("/insert")
    void insert(@RequestBody Prescription prescription) {
        prescriptionService.insert(prescription);
    }

    @RequestMapping("/update")
    void update(@RequestBody Prescription prescription) {
        prescriptionService.update(prescription);
    }

    @RequestMapping("/delete")
    void delete(long id) {
        prescriptionService.delete(id);
    }



}
